/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package HTTPDownloader;

import java.io.Serializable;

/**
 *
 * @author Lone_Wolf
 */
public class Range implements Serializable {

    private long start;
    private long downloaded;
    private long end;

    public void setEnd(long end) {
        this.end = end;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getEnd() {
        return end;
    }

    public long getStart() {
        return start;
    }

    public long getLength() {
        return (end - start);
    }

    public long getDownloaded() {
        return downloaded;
    }

    public void setDownloaded(long downloaded) {
        this.downloaded = downloaded;
    }

    public void addDownloaded(long downloaded) {
        this.downloaded += downloaded;
    }

    public long getRemaining() {
        return getLength() - this.downloaded;
    }

    public Range(long start, long end) {
        this.start = start;
        this.end = end;
        this.downloaded = 0;
    }

    public Range(long start, long end, long downloaded) {
        this.start = start;
        this.end = end;
        this.downloaded = downloaded;
    }
}
